//
//  TKIMBaseMsgView.h
//  TKIM
//
//  Created by liupm on 15/10/14.
//  Copyright © 2015年 liupm. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "UIResponder+Router.h"

//长按消息事件
#define TKIMMsgLongPressEvent @"TKIMMsgLongPress"
#define TKIMSrvTemplOnclick @"TKIMSrvTemplOnclick"
#define TKIMMsgHeadImageTapEvent @"TKIMMsgHeadImageTapEvent"

//声音播放停止事件
#define TKIMAudioEvent @"TKIMAudioEvent"
//去打分页面
#define TKIMToScoreEvent @"TKIMToScoreEvent"
//链接被点击
#define TKIMLinkOnClick @"TKIMLinkOnClick"


//头像的宽
#define TKIMChatHeadImageViewWidth 45

//消息横向间隔
#define TKIMChatMsgHorizontalPadding 3

//消息间距
#define TKIMChatMsgPadding 16

//消息发送的背影图片
#define TKIMChatMsgSenderImage @"im_bg_chat_sendMsg"

//消息接收的背景图片
#define TKIMChatMsgReceiverImage @"im_bg_chat_reciveMsg"


@interface TKIMBaseMsgView : UIView
//背景
@property(nonatomic,strong) UIImageView *backgroundImageView;
//背景图
@property(nonatomic,strong) UIImage *backgroundImage;
//消息
@property(nonatomic,strong) TKIMMessage *message;
//用户头像
@property(nonatomic,strong) UIImageView *headImageView;
//用户名
@property(nonatomic,strong) UILabel *userNameLabel;

//用户名高度
@property(nonatomic,assign) CGFloat userNameHeight;

//消息状态
@property(nonatomic,strong) UIImageView *msgSateView;



-(instancetype)initWithFrame:(CGRect)frame  msg:(TKIMMessage *)msg;


/**
 *  @Author lpm, 15-07-30 11:07:12
 *
 *  @brief  组装界面
 */
-(void)drawView;


/**
 *  @Author lpm, 15-11-06 14:11:34
 *
 *  @brief  获得消息的frame
 *
 *  @param message
 *  @param size
 *
 *  @return
 */
-(CGRect)getMsgFrame:(TKIMMessage *)message size:(CGSize)size;


/**
 *  @Author lpm, 15-11-05 09:11:23
 *
 *  @brief  行高
 *
 *  @return
 */
+(CGFloat)heightForRow:(TKIMMessage *)msg;

@end
